<script type="text/javascript">
$.userForm =
{
  submit: function() {
    $('input[name=password_a]').val($.sha1($('input[name=password_a]').val()));
    $('input[name=password_b]').val($.sha1($('input[name=password_b]').val()));
    return true;
  }
}
</script>

<div class="ui-amp-container">
  <h2><?php echo $formTitle ?>
    <?php echo $actions->buildFormLinks() ?></h2>

  <?php $this->AmpForm->dataProvider = array($user, 'get'); ?>

  <?php echo $this->AmpForm->form(array('onsubmit'=>'return $.userForm.submit();'),
    $this->AmpForm->text('username', __('Username').':', 'username', array('input'=>array('disabled'=>'disabled'), 'label'=>array('style'=>'width:120px;'))),
    $this->AmpForm->select('locale', __('Locale'), $locales, 'locale', array('label'=>array('style'=>'width:120px;'))),
    $this->AmpForm->fieldset(__('Password'), null,
      $this->AmpForm->password('password_a', __('Password').':', array('label'=>array('style'=>'width:120px;'))),
      $this->AmpForm->password('password_b', __('Repeat password').':', array('label'=>array('style'=>'width:120px;')))
    ),
    $this->AmpForm->save()
  ) ?>

  <nav class="ui-amp-form-actions"><?php echo __('Actions') ?>: <?php echo $actions->buildFormActions($user) ?></nav>
</div>